<template>
	<view class="box">
		<!-- <h2>活动列表</h2> -->
		<view v-if="JSON.stringify(list) !== '[]'">
			<view class="active-list clearfix" @click="gotoDetail(item)" v-for="item in list" :key="item.id">
				<view class="active-img"><image :src="item.image?item.image:'/static/page1.jpg'" alt="" /></view>
				<view class="active-list-right">
					<text>{{item.activityName?item.activityName:'2023年清远百川招聘'}}</text>
					<view class="active-time">
						<view class="iconfont icon-shijian"></view>
						<view class="active-time-text">{{item.startTime?item.startTime : 162174 | date}}到{{item.endTime?item.endTime:1724742 | date}}</view>
					</view>
					<view class="active-address">
						<view class="iconfont icon-dibiao"></view>
						<view class="action-address-text">{{item.location?item.location : '清远市'}}</view>
					</view>
				</view>
			</view>
		</view>
		<view  v-else>
			<view class="active-list clearfix" @click="gotoDetail">
				<view class="active-img"><image src="/static/page1.jpg" alt="" /></view>
				<view class="active-list-right">
					<text>2023年清远百川招聘</text>
					<view class="active-time">
						<view class="iconfont icon-shijian"></view>
						<view class="active-time-text">2022-12-23到2023-12-23</view>
					</view>
					<view class="active-address">
						<view class="iconfont icon-dibiao"></view>
						<view class="action-address-text">清远市</view>
					</view>
				</view>
			</view>
			<view class="active-list clearfix" @click="gotoDetail">
				<view class="active-img"><image src="/static/page1.jpg" alt="" /></view>
				<view class="active-list-right">
					<text>2023年清远百川招聘</text>
					<view class="active-time">
						<view class="iconfont icon-shijian"></view>
						<view class="active-time-text">2022-12-23到2023-12-23</view>
					</view>
					<view class="active-address">
						<view class="iconfont icon-dibiao"></view>
						<view class="action-address-text">清远市</view>
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import {getactiveInfo} from '@/http/api.js'
	export default {
		data() {
			return {
				list:[]
			};
		},
		onShow() {
			this.getlist()
		},
		methods:{
			gotoDetail(item){
				uni.navigateTo({
					url:'/subpkg/active/activeDetail?id='+item.id
				})
			},
			async getlist(){
				const res= await getactiveInfo()
				// console.log(res);
				this.list=res.rows
			}
		}
	}
</script>

<style lang="scss" scoped>   
 .box{
	 padding: 60rpx;
 }
	.clearfix:after,.clearfix:before{
	    content: "";
	    display: table;
	}
	.clearfix:after{
	    clear: both;
	}
	.clearfix{
	        zoom: 1;
	    }
	h2{
		height: 70rpx;
		padding-left: 30rpx;
		line-height: 70rpx;
		font-size: 40rpx;
	}
	.active-list{
		display: flex;
		// height: 200rpx;
		align-items: center;
		width: 100%;
		border: 1rpx 0 2rpx 0;
		border-radius: 12rpx;
		box-shadow:0rpx 4rpx 12rpx 4rpx #c6c6c6;
		margin-bottom: 22rpx;
		.active-img{
			width: 200rpx;
			height: 200rpx;
			margin: 14rpx 20rpx;
		}
		.active-list-right{
			flex: 1;
			margin-top: 14rpx;
			text{
				height: 50rpx;
				font-size:36rpx;
				line-height: 50rpx;
				text-overflow:ellipsis; 
				font-weight: 700;
			}
			.active-time{
				display:flex;
				// height: 50rpx;
				margin: 16rpx 0;
				.icon-shijian{
					padding-right: 8rpx;
					font-size: 40rpx;
					color: #000000;
					
				}
				.active-time-text{
					font-size: 30rpx;
					color: dimgrey;
				}
			}
			.active-address{
				display:flex;
				height: 50rpx;
				color: dimgrey;
				.icon-dibiao{
					padding-right: 8rpx;
					font-size: 40rpx;
					color: #101010;
				}
				.active-address-text{
					line-height: 50rpx;
					font-size: 30rpx;				
				}
			}
		}
	}
</style>
